package com.sofwin.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sofwin.dto.IpoFirstSecondDto;
import com.sofwin.mapper.DIposecondMapper;
import com.sofwin.pojo.DIposecond;
import com.sofwin.pojo.DIposecondExample;
import com.sofwin.service.DIpoFirstSecondService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Project: ssm-parent
 * @Description:
 * @Author : abiao
 * @date Date : 2021年04月24日 上午 10:42
 */
@Service
public class DIpoFirstSecondServiceImpl implements DIpoFirstSecondService {

    @Autowired
    private DIposecondMapper iposecondMapper;

    @Override
    public PageInfo<IpoFirstSecondDto> selectFirstSecond(DIposecond iposecond, Integer pageNumber, Integer pageSize) {
        String secondName = iposecond.getSecondName();
        if (secondName != null && secondName != ""){
            secondName = "%"+secondName+"%";
        }
        PageHelper.startPage(pageNumber,pageSize);
        List<IpoFirstSecondDto> dto = iposecondMapper.selectFSDto(secondName);

        return new PageInfo<IpoFirstSecondDto>(dto);
    }
}
